clc;
clear;
% 接口登入
thsLogin =THS_iFinDLogin('xnyf018','SWSC600369');

Start_Date = '2013-12-31';
End_Date = '2024-11-23';

% [cpi,~,~,~,~]=THS_EDB('M002826730','', Start_Date, End_Date,'format:table');
% writetable(cpi, 'data/cpi.csv')

% [ppi,~,~,~,~]=THS_EDB('M002826865','', Start_Date, End_Date,'format:table');
% writetable(ppi, 'data/ppi.csv')

% [nd_10y,~,~,~,~]=THS_EDB('M005959895','', Start_Date, End_Date,'format:table');
% writetable(nd_10y, 'data/nd_10y.csv')

% [sh_hs,~,~,~,~]=THS_EDB('M009067844','', Start_Date, End_Date,'format:table');
% writetable(sh_hs, 'data/sh_hs.csv')

% [ndint_1y,~,~,~,~]=THS_EDB('L001618148','', Start_Date, End_Date,'format:table');
% writetable(ndint_1y, 'data/ndint_1y.csv')
% 
% [ndint_10y,~,~,~,~]=THS_EDB('L001619092','', Start_Date, End_Date,'format:table');
% writetable(ndint_10y, 'data/ndint_10y.csv')

% [midlong,~,~,~,~]=THS_EDB('M003986589','', Start_Date, End_Date,'format:table');
% writetable(midlong, 'data/midlong.csv')

% [usa6m,~,~,~,~]=THS_EDB('G002600768','', Start_Date, End_Date,'format:table');
% writetable(usa6m, 'data/usa6m.csv')

% [usd,~,~,~,~]=THS_EDB('G002600885','', Start_Date, End_Date,'format:table');
% writetable(usd, 'data/usd.csv')

% [pmi,~,~,~,~]=THS_EDB('M002811185','', Start_Date, End_Date,'format:table');
% writetable(pmi, 'pmi.csv')

% [shangzheng,~,~,~,~]=THS_EDB('M002845711','', Start_Date, End_Date,'format:table');
% writetable(shangzheng, 'shangzheng.csv')

% [zhongzheng,~,~,~,~]=THS_EDB('M010806023','', Start_Date, End_Date,'format:table');
% writetable(zhongzheng, 'zhongzheng.csv')

[sh_stock_turnover,~,~,~,~]=THS_EDB('S004226209','', Start_Date, End_Date,'format:table');
writetable(sh_stock_turnover, 'data/sh_stock_turnover.csv')

[margin_trade,~,~,~,~]=THS_EDB('S004273895','', Start_Date, End_Date,'format:table');
writetable(margin_trade, 'data/margin_trade.csv')

[sh_debt_turnover,~,~,~,~]=THS_HQ('000012.SH','amount','',Start_Date, End_Date,'format:table');
writetable(sh_debt_turnover, 'data/sh_debt_turnover.csv')



